package com.lovo.homework;

import com.sun.source.tree.ContinueTree;

import java.util.Scanner;

public class Player extends Role {
    public void choiceFist() {
        while (true)
            try {
                Scanner sc = new Scanner(System.in);
                System.out.println("请选择：0-石头、1-剪刀、2-布");
                int opt = sc.nextInt();
                switch (opt) {
                    case 0:
                        setFist(0);
                        System.out.println("你选择出石头！");
                        return;
                    case 1:
                        setFist(1);
                        System.out.println("你选择出剪刀！");
                        return;
                    case 2:
                        setFist(2);
                        System.out.println("你选择出布");
                        return;
                    default:
                        System.out.println("请输入0-2进行选择");

                }


            } catch (Exception e) {
                System.out.println("输入有误");
                continue;
            }

    }
}


